﻿package org.atk.components.treegridview {
	
	/**
	 * ...
	 * @author AeTky
	 */
	public class DefaultTreeGridViewRowData implements ITreeGridViewRowData {
		private var values:Array=null;
		
		public function DefaultTreeGridViewRowData(values:Array) {
			this.values = values;
		}
		
		/* INTERFACE org.atk.components.treegridview.ITreeGridViewRowData */
		private function isValidIndex(columnIdx:int):Boolean {
			if (values == null) return false;
			if (columnIdx < 0) return false;			
			return columnIdx < values.length;
		}
		public function getValue(columnIdx:int):*{
			if (!isValidIndex(columnIdx)) return undefined;
			return values[columnIdx];
		}
		
		public function setValue(columnIdx:int, value:*):void{
			if (!isValidIndex(columnIdx)) return;
			values[columnIdx] = value;
		}
		
		public function get Values():Array { return values; }
		public function toString():String {
			return ""+values;
		}
		
	}
	
}